//
//  MNDInvestmentDetailCell.m
//  minidai
//
//  Created by Steven.Yung on 2017/5/15.
//  Copyright © 2017年 迷你金服. All rights reserved.
//

#import "MNDInvestmentDetailCell.h"

@interface MNDInvestmentDetailCell ()

/*！回款本金 */
@property (weak, nonatomic) IBOutlet UILabel *returnPrincipalLabel;
/*! 加息奖励 */
@property (weak, nonatomic) IBOutlet UILabel *rewardMoneyLabel;
/*! 管理费 */
@property (weak, nonatomic) IBOutlet UILabel *managementExpenseLabel;
/*! 回款利息 */
@property (weak, nonatomic) IBOutlet UILabel *interestLabel;
/*! 续投奖励 */
@property (weak, nonatomic) IBOutlet UILabel *continuedInvestmentRewardLabel;
/*! 逾期费用 */
@property (weak, nonatomic) IBOutlet UILabel *overdueExpensesLabel;
/*! 起止日期 */
@property (weak, nonatomic) IBOutlet UILabel *datesLabel;
/*! 实际回款日期 */
@property (weak, nonatomic) IBOutlet UILabel *returnDateLabel;

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *bottomConstraint;

@end

@implementation MNDInvestmentDetailCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)configCellWithModel:(MNDInvestmentDetailReturnModel *)model {
    
    self.returnPrincipalLabel.text = [NSString stringWithFormat:@"回款本金(元): %@", model.principal];
    self.rewardMoneyLabel.text = [NSString stringWithFormat:@"赠利奖励(元): %@", model.coupon_reward];
    self.managementExpenseLabel.text = [NSString stringWithFormat:@"管理费(元): %@", model.tenderfee];
    self.interestLabel.text = [NSString stringWithFormat:@"回款利息(元): %@", model.interest];
    self.continuedInvestmentRewardLabel.text = [NSString stringWithFormat:@"续投奖励(元): %@", model.renew_reward];
    self.overdueExpensesLabel.text = [NSString stringWithFormat:@"逾期费用(元): %@", model.overduefee];
    self.datesLabel.text = [NSString stringWithFormat:@"起止日期: %@至%@", model.start_date, model.end_date];
    if ([model.return_time isEqualToString:@"-1"]) {
        
        [self.returnDateLabel setHidden:YES];
        self.bottomConstraint.constant = 0.0;
//        self.returnDateLabel.text = [NSString stringWithFormat:@"回款日期: %@", model.end_date];
    } else {
        self.returnDateLabel.text = [NSString stringWithFormat:@"实际回款日期: %@", model.return_time];
    }
    
}

@end
